-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update DFA path runscript [ana5; runscripts] #1039
base: master
Are you sure you want to change the base?
Conversation
Hello @leon-wagner! Thanks for updating this PR.
Comment last updated at 2024-12-02 12:22:49 UTC |
ea6318f
to
83f2042
Compare
…on.py - com1 overrides moved from runScript to ini - new --runDFA flag logic - path is generated from fields by default (resType changed accordingly) - moved runScript to main avaframe folder (for QGIS) - clean DFAPath output folder in avadir before generating path (necessary for QGIS, so if script is run multiple times, paths that are previously generated are not returned to QGIS)
- removed coulomb friction and other com1 overrides, path is now generated from standard run - added option to add velocity info when FV is saved
… instead of not at all (avoids issues with QGIS) - adjusted corresponding error message - accordingly adjusted plot generation to exclude splitPoints set at the top
- add missing discrete color levels for Travel Angle and changed it from a mix of lapaz and batlow to nuuk color map - grey out faulty legend plotting line thereby removing user warning: “no artists found with label”… in log and removes empty legend in top right corner of birds eye view panel - more descriptive runDFA flag comment in runScript
- set dt to 1
…t or other) - adjustment to writePoint2SHPfile to account for pytest. tested and it still fixes the addressed problem.
- adjusted runDFAModule flag, added to ini - renamed functions in DFAPathGeneration.py to reflect better what they do
|
||
return avaPath, splitPoint | ||
|
||
def generateMassAveragePath(avalancheDir, pathFromPart, simName, dem, addVelocityInfo=False, flagAvaDir=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function generateMassAveragePath
has 7 arguments (exceeds 6 allowed). Consider refactoring.
# Clean avalanche directory of old work and output files from module | ||
initProj.cleanModuleFiles(avalancheDir, com1DFA, deleteOutput=True) | ||
# create and read the default com1DFA config (no local is read) | ||
com1DFACfg = cfgUtils.getModuleConfig(com1DFA, fileOverride='', modInfo=False, toPrint=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 7 locations. Consider refactoring.
@@ -148,11 +230,11 @@ def getDFAPathFromPart(particlesList, addVelocityInfo=False): | |||
return avaProfileMass | |||
|
|||
|
|||
def getDFAPathFromField(fieldsList, fieldHeader, dem): | |||
def getMassAvgPathFromFields(fieldsList, fieldHeader, dem): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function getMassAvgPathFromFields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
|
||
return avaProfileMass, particlesIni | ||
|
||
|
||
def getDFAPathFromPart(particlesList, addVelocityInfo=False): | ||
def getMassAvgPathFromPart(particlesList, addVelocityInfo=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function getMassAvgPathFromPart
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
# as long as it produces some pta, particles or FT, FM and FV results | ||
# create dataFrame of results (read DFA data) | ||
simDF, _ = cfgUtils.readAllConfigurationInfo(avalancheDir) | ||
if simDF is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 23a123d and detected 6 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 21.7% (50% is the threshold). This pull request will bring the total coverage in the repository to 69.5% (0.0% change). View more on Code Climate. |
With the goal of addressing #848, as well as rework of the runScript
Summary of changes:
restructured runComputeDFAPath script to make it compatible with QGIS connector, moved script to /avaframe
the --runDFA flag can now be set to run com1 to generate results for path generation (this was previously handled by a True/False argument within the runScript). The avaFolder may now also be added to the run command.
settings that are used to override com1DFA run were moved to DFAPath cfg as overrides. changed some of the overrides, path is now essentially generated from a default null com1 run with standard friction and particle settings. path is now also generated from fields as default, instead of from particles.
if splitpoint is not found with the set angle (default 20 degrees), the splitpoint is now generated at the top of the path, instead of not creating one. changed plot output accordingly.
added missing discrete color levels for travel angle, so now colors in the path output plot are generated with the same levels.
color map for travel angles is now Crameri:nuuk (previously was undefined and a mix of Crameri:batlow and Crameri:lapaz)
fixes above remove 2 user warnings in DFAPath script log, one with legend, one with cmap
fix DFA path generation returns no coordinates for splitpoint #1038
To do: